<template>
  <div class="info-list">
    <div class="info-item" v-for="item in list" :key="item.key">
      <div class="title-wrapper">{{ item.title }}</div>

      <div class="news-list">
        <div
          class="news-item"
          v-for="(inner, index) in item.children"
          :key="inner.key"
          @click="$router.push('/info/' + inner.title)"
        >
          <div class="left">{{ index + 1 }}. {{ inner.title }}</div>
          <div class="time">{{ inner.date }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["list"]
};
</script>

<style lang="less" scoped>
.info-list {
  display: flex;
  justify-content: space-between;
  padding: 30px 100px 10px 30px;
  flex-wrap: wrap;

  .info-item {
    width: 49%;
    min-height: 200px;
    border: 1px solid #a6d0f4;
    margin-bottom: 16px;
    border-radius: 1px;

    .title-wrapper {
      background: linear-gradient(@white, #e7f4fe);
      line-height: 34px;
      color: #0090dd;
      font-weight: bold;
      border-bottom: 1px solid #a6d0f4;
      font-size: 15px;
      padding-left: 12px;
    }

    .news-list {
      padding: 12px 20px;
    }

    .news-item {
      display: flex;
      color: @text-color-1;
      margin-bottom: 12px;
      border-bottom: 1px dashed @border-color;
      cursor: pointer;
      &:hover {
        color: #0090dd;
      }

      .left {
        flex: 1;
        .ellipsis();
        margin-right: 12px;
      }

      .time {
        font-size: 13px;
      }
    }
  }
}
</style>
